package szc.common.code.rule;

import szc.common.code.enums.CodeLineParserEnum;

/**
 * @desc 解析器：空行
 * @author songzc
 * @date 2022/6/18
 */
public class WhiteCodeLineParser extends CodeLineParserAbstract {

    public WhiteCodeLineParser() {
        this.parserType = CodeLineParserEnum.WHITE_CODE_LINE;
    }

    private static String WHITE_LINE_PATTEN = "^[//s&&[^//n]]*$";

    @Override
    public boolean parseCodeLine() {
        if (this.codeLine.matches(WhiteCodeLineParser.WHITE_LINE_PATTEN)) {
            ++this.lineCount;
            return true;
        }
        return false;
    }

}